//
//  RJTools.h
//  AirQuality
//
//  Created by Po on 15/3/11.
//  Copyright (c) 2015年 Po. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "Reachability.h"
#import "RJLoadView.h"
@interface RJTools : NSObject

@property (nonatomic, copy) void (^ toolBlock)(id,id);

/**等大小缩放Rect*/
+ (CGRect)getReSizeRect:(CGRect)rect size:(CGFloat)size;

/**获取指定格式日期*/
+ (NSString *)getTimeWithFormat:(NSString *)format;

/**获取指定日期的指定格式*/
+ (NSString *)getTimeWithFormat:(NSString *)format time:(NSDate *)date;

/**获取两日期间隔*/
+ (NSUInteger)getDayWithStartDay:(NSDate *)startDate endDay:(NSDate *)endDay;

/**判断String是否为纯数字*/
+ (BOOL)isNumberString:(NSString *)string;

/**显示信息一段时间*/
+ (void)showMsg:(NSString *)msg time:(CGFloat)time;

/**弹窗*/
+ (void)showTitle:(NSString *)title msg:(NSString *)msg cancelString:(NSString *)cancelString vc:(UIViewController *)vc;

/**无网络弹窗*/
+ (void)showTitle:(NSString *)title msg:(NSString *)msg cancelString:(NSString *)cancelString confirmString:(NSString *)confirmString confirmBlock:(void(^)(void))confirmBlock vc:(UIViewController *)vc;

+(UIImage *)getImageFromView:(UIView *)view;

/**获取汉字拼音*/
+ (NSString *)getPinyinOfString:(NSString *)string;

/**检测当前网络状态*/
+ (NetworkStatus)checkNetStatus;

/**获取对应AQI最大最小值*/
+ (NSUInteger)getAQIMathNumber:(NSUInteger)number;

/**获取AQI污染等级*/
+ (NSString *)getRankWithNumber:(NSUInteger)num;

+ (NSUInteger)getRankWithType:(NSString *)type num:(CGFloat)num;

/**获取缩写对应全称*/
+ (NSString *)getQulityString:(NSString *)type;

/**转换关键字为大写*/
+ (NSString *)getTrueTypeTitlleWithCellKey:(NSString *)key;

/**转换关键字为小写*/
+ (NSString *)getTrueKeyTitlleWithTitle:(NSString *)title;

/**获取AQI等级颜色*/
+ (UIColor *)getColorWithAirNum:(NSInteger)num;
+ (UIColor *)getColorWithAirNum:(CGFloat)num type:(NSString *)type alpha:(CGFloat)alpha;
+ (UIColor *)getNewColorWithAirNum:(CGFloat)num type:(NSString *)type alpha:(CGFloat)alpha;

/**获取正确的类型标题数组*/
+ (NSArray *)getTrueCellTitleWithKeys:(NSArray *)keys;

/**获取正确的类型数组*/
+ (NSArray *)getKeysArrayWithTitles:(NSArray *)titles;

/**获取与Key对应的标题数组*/
+ (NSArray *)getTitlesArrayWithKeys:(NSArray *)keys;

/**获取污染等级颜色数组*/
+ (NSArray *)getColorArrayWithAlpha:(CGFloat)alpha;

/**获得PM2.5的区间*/
+ (NSUInteger)getPM25MathNum:(CGFloat)num;

/**计算AQI区间*/
+ (NSUInteger)getAQINumber:(CGFloat)data;

/**同比例缩放-设置宽度*/
+ (CGSize)reSetSize:(CGSize)size width:(CGFloat)width;

/**折线图颜色数组*/
+ (NSArray *)getLineColors;
/**直管站折线图颜色数组*/
+ (NSArray *)getCstationColors;
/**获取标准的PM2.5*/
+ (NSMutableAttributedString *)getPMString:(NSString *)string;
+ (NSArray *)returnRankWithType:(NSString *)type num:(CGFloat)num;
+ (NSUInteger)getRankWithType1:(NSString *)type num1:(CGFloat)num;
/**
 *  获取颜色
 *
 *  @param num
 *  @param type
 *  @param alpha
 *
 *  @return
 */
+ (UIColor *)getColorWithAirNum1:(CGFloat)num type1:(NSString *)type alpha1:(CGFloat)alpha;
/**
 *  更改中心坐标经纬度
 *
 *  @param cityName   城市名
 *  @param longtitude
 *
 *  @return
 */
+ (CGFloat)getCityCenterLatitudeWithCityName:(NSString *)cityName withLongtitude:(CGFloat)longtitude;
+ (CGFloat)getCityCenterLatitudeWithCityName:(NSString *)cityName withLatitude:(CGFloat)latitude;
+ (CGFloat)getLatitudeWithCityName:(NSString *)cityName withLongtitude:(CGFloat)longtitude;
+ (CGFloat)getLatitudeWithCityName:(NSString *)cityName withLatitude:(CGFloat)latitude;
/**
 *  设置IAQI的颜色
 */
+ (UIColor *)toolGetColorByIaqi:(NSString *)iValue;
/**
 *  根据I值得到颜色值
 *
 *  @param num I值
 *
 *  @return 颜色
 */
+ (UIColor *)getColorWithAirINum:(CGFloat)num;
/**
 *  返回等级
 *
 *  @param num I值
 *
 *  @return 等级
 */
+ (NSUInteger)getRankWithNum:(CGFloat)num;
@end
